{block #title}Sanita{/block}
{block #content}
<h1>Sanita</h1>
<a n:foreach="$sanitaryList as $sanitary" href="{link detail, $sanitary->id_sanitary, $sanitary->title}" title="více informací" class="sanitary-container{if $iterator->counter % 4 == 0} tile-right{/if}">
    {var $sanitaryImages = $sanitary->related('sanitary_has_images')}
    {if count($sanitaryImages) > 0}
        {? $sanitaryImages->rewind(); }
        {var $sanitaryImage = $sanitaryImages->current()}
        <div class="sanitary-img-wrapper">
            <img src="{imageThumbPath $sanitaryImage->image->id_image}" alt="akcni zbozi" />
        </div>
    {/if}
    
    <div class="tile-title">
        {$sanitary->manufacturer->title|upper}
    </div>
    <div class="tile-info">
        {$sanitary->code}<br />
        {$sanitary->series}<br />
        {if !empty($sanitary->width)}<strong>š</strong>: {$sanitary->width} cm {/if}
        {if !empty($sanitary->height)}, <strong>v</strong>: {$sanitary->height} cm {/if}
        {if !empty($sanitary->depth)}, <strong>h</strong>: {$sanitary->depth} cm {/if}<br />
        {var price = floor($sanitary->price * (1 - $sanitary->manufacturer->discount / 100))}
        <span class="tile-price">{$price|number:2:',':' '} Kč</span>
    </div>
</a>
{/block}
